<?php

class Application_Model_Contacts extends Application_Model_Base
{

    public function sendMail(array $contactDetails)
    {
    	$settings = array(
    			'ssl'=>'ssl',
    			'port'=>465,
    			'auth' => 'login',
    			'username' => 'shlomiphp@gmail.com',
    			'password' => '24681012'
    	);
    	
    	$transport = new Zend_Mail_Transport_Smtp('smtp.gmail.com', $settings);
    	$emailFrom = $contactDetails['email'];
    	$nameFrom = $contactDetails['name'];
    	$emailTo = 'kineret555@gmail.com';
    	$nameTo = 'kineret555';
    	
    	$mail = new Zend_Mail('UTF-8');
    	$mail->setReplyTo($emailFrom, $nameFrom);
    	$mail->setFrom($emailFrom, $nameFrom);
    	$mail->addTo($emailTo, $nameTo);
    	$mail->setSubject($contactDetails['subject']);
    	$mail->setBodyText($contactDetails['content']);
    	$mail->send($transport);
    }

}


